<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: shanpengfei
  Date: 2019/2/28
  Time: 5:58 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<c:set var="basePath" value="/gyp"></c:set>

<style>
    .register-form {
        width: 800px;
        margin: 100px auto 0 auto;
    }
    input {
        width: 500px;
        height: 40px;
        margin: 5px 0;
    }
</style>

<jsp:include page="template_header.jsp"></jsp:include>

<script src="${basePath}/js/qiniu.js"></script>

<div class="register-form">
    <form action="${basePath}/user/register" method="post">
        <input type="hidden" name="id" value="${user.id}"><br>
        <input type="text" name="username" value="${user.username}" placeholder="用户名"><br>
        <c:if test="${user.id == null}">
            <input type="password" name="password" value="${user.password}" placeholder="密码"><br>
            <%--<div id="container">--%>
                <%--<a class="btn btn-default btn-lg " id="pickfiles" href="#" >--%>
                    <%--<span>上传志愿者图片，请选择文件</span>--%>
                <%--</a>--%>
            <%--</div>--%>
            <%--<input id="urlText" name="pic" type="hidden" value=""></input>--%>
        </c:if>
        <input type="text" name="name" value="${user.name}" placeholder="姓名"><br>
        <%--<input type="number" name="sex" value="${user.sex}" min="1" max="2" placeholder="性别，1：男，2：女"><br>--%>
        <select name="sex" class="i2s-num">
            <c:if test="${user.sex==1}">
                <option value="1" selected>男</option>
                <option value="2">女</option>
            </c:if>
            <c:if test="${user.sex==2}">
                <option value="1">男</option>
                <option value="2" selected>女</option>
            </c:if>
            <c:if test="${user.sex==null}">
                <option value="1">男</option>
                <option value="2">女</option>
            </c:if>
        </select>
        <input type="text" name="birthday" value="${user.birthday}" placeholder="出生日期"><br>
        <input type="phone" name="phone" value="${user.phone}" placeholder="联系电话"><br>
        <input type="email" name="email" value="${user.email}" placeholder="邮箱"><br>
        <input type="text" name="address" value="${user.address}" placeholder="家庭地址"><br>
        <input type="submit" value="注册">
    </form>
</div>

<c:if test="${status==1}">用户名已存在</c:if>
<c:if test="${status==2}">保存失败</c:if>
<c:if test="${status==3}">用户名为空</c:if>

<%--<jsp:include page="template_footer.jsp"></jsp:include>--%>
